// Finds the saved search that has been specified in the URL. This should be a function.
if (args.name != undefined) {
	name =  "+@\\{vgr.model\\}listName:\"" + args.name + "\"";
	path = "((PATH:\"/app:company_home/cm:vgr/cm:Saved_x0020_Searches//*\") AND ";
	type = "(TYPE:\"{vgr.model}savedSearch\"))";
	
	savedSearchResult = search.luceneSearch(name + path + type);
	
	if (savedSearchResult[0] != undefined) {
		savedSearch = savedSearchResult[0];
	} else {
		status.code = 404;
		status.message = "Den sparade s&ouml;kningen: " + args.name + " hittades inte.";
		status.redirect = true;
	}
} else {
	 status.code = 404;
	 status.message = "Den sparade s&ouml;kningen: " + args.name + " hittades inte.";
	 status.redirect = true;
}

savedSearch.remove();